﻿using System.Web;

namespace Limestone.Storage.XML
{
    public class XmlStorageConfig:IXmlStorageConfig
    {
        public string FolderIndexPageName { get; set; }
        public string BasePagePath { get; set; }
        public string BaseTemplatePath { get; set; }
        public string BaseTrashcanPath { get; set; }


        public XmlStorageConfig()
        {
            FolderIndexPageName = "_folderindex";
        }

        public XmlStorageConfig(HttpContext httpContext)
        {
            BasePagePath = httpContext.Server.MapPath("/Pages/").Replace("/", @"\");
            BaseTemplatePath = httpContext.Server.MapPath("/Templates/").Replace("/", @"\");
            BaseTrashcanPath = httpContext.Server.MapPath("/Trashcan/").Replace("/", @"\");

            FolderIndexPageName = "_folderindex";
        }
    }
}
